<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<style>
	html,
	body {
		overflow: hidden;
		background: #FBFBFB;
	}
	
	.table td {
		vertical-align: middle;
	}
</style>
<!--{template common/header_simple_end}-->
<nav class="navbar navbar-default bs-navbar-default navbar-fixed-top" role="navigation" style="margin:0;padding:0 10px;">
	<ul class="nav nav-pills tag-container nav-pills-bottomguide clearfix">
		<li <!--{if !$tagid}-->class="active"<!--{/if}-->>
			<a href="{DZZSCRIPT}?mod=market">{lang all}</a>
		</li>
		<!--{loop $tags  $value}-->
		<li <!--{if $tagid==$value[tagid]}-->class="active"<!--{/if}-->>
			<a href="{DZZSCRIPT}?mod=market&tagid=$value[tagid]">$value[tagname]</a>
		</li>
		<!--{/loop}-->
		<li class="pull-right " style="margin:4px 0;">
			<form name="search" action="{DZZSCRIPT}" method="get">
				<input type="hidden" name="mod" value="market" />
				<div class="input-group" style="width:180px">
					<input name="keyword" type="text" class="form-control input-sm" value="$keyword" placeholder="{lang application_name_suppliers}">
					<a class="input-group-addon" herf="javascript:;" onclick="this.parentNode.parentNode.submit()"><i class="glyphicon glyphicon-search"></i></a>
				</div>
			</form>
		</li>
	</ul>
</nav>
<div class="bs-container clearfix">
	<div class="bs-main-container">
		<div class="main-content clearfix">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>{lang appname}</th>
						<th>{lang supplier}</th>
						<th>{lang label}</th>
						<th>{lang edit}</th>
					</tr>
				</thead>
				<!--{loop $list $value}-->
				<tr>
					<td>
						<a href="$value[url]" target="_blank" isinstall="$value[isinstall]" onclick="return Preview('{$value[appid]}');" title="{lang preview}"><img src="$value[appico]" />$value[appname]</a>
					</td>
					<td>$value[vendor]</td>
					<td>
						<!--{loop $value[tags] $key $value1}-->
						<a href="{DZZSCRIPT}?mod=market&tagid=$value1[tagid]">$value1[tagname]</a>
						<!--{/loop}-->
					</td>
					<td>
						<!--{if $value[isinstall]}-->
						<span>{lang been_install}</span>
						<!--{else}-->
						<a id="app_$value[appid]" href="javascript:;" isinstall="$value[isinstall]" onclick="Install('{$value[appid]}')"><span>{lang install}</span></a>
						<!--{/if}-->
					</td>
				</tr>
				<!--{/loop}-->
				<!--{if $multi}-->
				<tr>
					<td colspan="20"> $multi</td>
				</tr>
				<!--{/if}-->
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
	jQuery('.left-drager').leftDrager_layout();
	var appdata = $jsondata;

	function Preview(appid) {
		try {
			if(appdata[appid]) parent._config.sourcedata.app[appid] = appdata[appid];
			parent.OpenApp(appid);
			return false
		} catch(e) {
			return true;
		}
	}

	function Install(appid) {
		try {
			if(appdata[appid]) parent._config.sourcedata.app[appid] = appdata[appid];
			else return;
			parent.showmessage('{lang being_installed}"' + appdata[appid].appname + '"，{lang please_wait1}', 'info', 0, 1, 'right-bottom');
			jQuery.getJSON('{DZZSCRIPT}?mod=market&do=install&appid=' + appid, function(json) {
				if(json.msg == 'success') {
					parent._config.appList.push(appid);
					parent._start.refreshlist();
					jQuery('#app_' + appid).find('span').html('{lang been_install}').unwrap();
					parent.showmessage(appdata[appid].appname + '{lang been_installed_start_menu}', 'success', 3, 1, 'right-bottom');
					parent._start.setStartTip(1);
				} else if(json.error) {
					parent.showmessage(json.error, 'info', 3, 1, 'right-bottom');
				}
			});
		} catch(e) {
			alert('{lang please_use_desktop}');
		}
	}
</script>
<!--{template common/footer_simple}-->